package org.emample

case object lx{
  def main(args: Array[String]): Unit = {
    var c1 = new N();
    c1.p();
    var c2 = new N("nn");
    c2.p()
    var c3 = new N("nnn", 20)
    c3.p()
  }
}


class N{
  private var name="zhangsan";
  private var age=18;
  print("主")
  def this(name: String){
    this();
    this.name=name;
    print("幅1")
  }
  def this(name: String,age: Int){
    this();
    this.name=name;
    this.age=age;
    print("幅2")
  }
  def p(){
    printf("name=%s,age=%d\n",this.name,this.age);
  }

}

